﻿<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="线路管理" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addData()"
                        ng-disabled="!btnPermission.routeBillAdd"
                        title="{{!btnPermission.routeBillAdd?'无权限执行此操作':''}}">新增</button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" title="配置表格列"
                            ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')">高级搜索
                    </button>
                    <div class="input-group pull-right clearfix">
                        <input type="text" class="form-control txt-search" placeholder="目的城市"
                            ng-model="condition.destinationCity">
                        <span class="input-group-addon cursor-pointer" ng-click="search(1)">搜索</span>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label">目的城市：</label>
                        <input type="text" name="destinationCity" ng-model="condition.destinationCity"
                            class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">出发城市：</label>
                        <input type="text" name="departureCity" ng-model="condition.departureCity" class="form-control">
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label">承运商：</label>
                        <input type="text" name="carrierOrgName" ng-model="condition.carrierOrgName"
                            class="form-control light-bg" ng-click="selectLogisticsCom()" readonly placeholder="请选择">
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true"
                has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !!itemCol.isFixed && itemCol.type !== 'operate'">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth"
                                            fixed-width="tbStyle.scrollLeft"></div>
                                    </th>
                                    <th width="80" class="border-r-none">
                                        操作
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                                <tr>
                                    <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-click="toSort(tableConfig.tableCol, $index)"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                        <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.scrollWidth">
                                        </div>
                                    </th>
                                </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span
                                            ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                            ng-if="!!itemCol.clickFn">
                                            {{item[itemCol.dataField]}}
                                        </a>
                                        <div class="font-0" ng-if="itemCol.type === 'operate'">
                                            <button class="btn btn-operate m-r-xs" ng-click="editData(item)"
                                                ng-disabled="!btnPermission.routeBillEdit"
                                                title="{{!btnPermission.routeBillEdit?'无权限执行此操作':''}}">编辑</button>
                                            <button class="btn btn-operate m-r-xs" ng-click="deleteData(item)"
                                                ng-disabled="!btnPermission.routeBillDelete"
                                                title="{{!btnPermission.routeBillDelete?'无权限执行此操作':''}}">删除</button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.scrollLeft">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody>
                                <tr ng-repeat="item in dataList track by $index"
                                    ng-class="{'row-selected': $index === markInfo.cueRow}"
                                    ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                        width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !itemCol.isFixed"
                                        title="{{item[itemCol.dataField]}}">
                                        <span
                                            ng-if="!itemCol.clickFn && itemCol.type !== 'operate'">{{item[itemCol.dataField]}}</span>
                                        <a class="btn-operate m-r-xs" ng-click="tdClick(item, itemCol.clickFn)"
                                            ng-if="!!itemCol.clickFn">
                                            {{item[itemCol.dataField]}}
                                        </a>
                                        <div class="font-0" ng-if="itemCol.type === 'operate'">
                                            <button class="btn btn-operate m-r-xs" ng-click="editData(item)"
                                                ng-disabled="!btnPermission.routeBillEdit"
                                                title="{{!btnPermission.routeBillEdit?'无权限执行此操作':''}}">编辑</button>
                                            <button class="btn btn-operate m-r-xs" ng-click="deleteData(item)"
                                                ng-disabled="!btnPermission.routeBillDelete"
                                                title="{{!btnPermission.routeBillDelete?'无权限执行此操作':''}}">删除</button>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0">暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="{{tabFlag.name}}" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="main-area d-t-35 d-b-60">
                <form name="form" class="main-wrap form-horizontal single-col p-t-xs clearfix" novalidate>
                    <div class="panel-bar clearfix">
                        <div class="pull-left">
                            <i></i>线路产品
                        </div>
                    </div>
                    <div class="clearfix p-t">
                        <!-- wangcan:等待后端接口 -->
                        <div class="form-group">
                            <label class="col-xs-2 control-label"><i>*</i>规则描述：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="ruleDes" class="form-control"
                                    ng-model="detailInfo.ruleDes" maxlength="50">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label"><i>*</i>承运商：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="carrierOrgName" ng-model="detailInfo.carrierOrgName"
                                    class="form-control light-bg" ng-click="selectLogisticsCarrier()" readonly
                                    placeholder="请选择">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">出发城市：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="customMaterialsNo" class="form-control"
                                    ng-model="detailInfo.departureCity" maxlength="50">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">目的城市：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="customMaterialsNo" class="form-control"
                                    ng-model="detailInfo.destinationCity" maxlength="50">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">里程（公里）：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="customMaterialsNo" class="form-control"
                                    ng-model="detailInfo.mileage" maxlength="10" yb-number-input disable-decimal="false"
                                    decimal-places="3">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">承诺时间（天）：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="customMaterialsNo" class="form-control"
                                    ng-model="detailInfo.commitmentTime" maxlength="5" yb-number-input>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label"><i>*</i>首重（KG）：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="firstWeight" class="form-control"
                                    ng-model="detailInfo.firstWeight" maxlength="10" yb-number-input disable-decimal="false"
                                    decimal-places="3">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label"><i>*</i>首重金额（元）：</label>
                            <div class="col-xs-5 wrapper-none">
                                <input type="text" name="firstAmount" class="form-control"
                                    ng-model="detailInfo.firstAmount" maxlength="10" yb-number-input disable-decimal="false"
                                    decimal-places="3">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">运费单价：</label>
                            <div class="col-xs-10 wrapper-none">
                                <ul class="row">
                                    <li class="m-b-xs clearfix" ng-repeat="item in detailInfo.list track by $index">
                                        <div class="pull-left" style="width: 16%;">
                                            <div class="col-xs-8">
                                                <input type="text" class="form-control" ng-model="item.weightStart"
                                                    yb-number-input disable-decimal="false" decimal-places="4"
                                                    maxlength="10">
                                            </div>
                                            <label class="col-xs-3 control-label text-center">~</label>
                                        </div>
                                        <div class=" pull-left" style="width: 16%;">
                                            <div class="col-xs-8">
                                                <input type="text" class="form-control" ng-model="item.weightEnd"
                                                    yb-number-input disable-decimal="false" decimal-places="4"
                                                    maxlength="10">
                                            </div>
                                            <label class="col-xs-3 control-label text-center">Kg</label>
                                        </div>
                                        <div class=" pull-left" style="width: 25%;">
                                            <label class="col-xs-4 control-label text-center">单价（元）：</label>
                                            <div class="col-xs-8">
                                                <input type="text" class="form-control" ng-model="item.unitPrice"
                                                    yb-number-input disable-decimal="false" decimal-places="2"
                                                    maxlength="10">
                                            </div>
                                        </div>
                                        <div class=" pull-left" style="width: 25%;">
                                            <label class="col-xs-4 control-label text-center">附加（元）：</label>
                                            <div class="col-xs-8">
                                                <input type="text" class="form-control" ng-model="item.additional"
                                                    yb-number-input disable-decimal="false" decimal-places="2"
                                                    maxlength="10">
                                            </div>
                                        </div>
                                        <i class="yb-icon ico-minus-o pull-left cursor-pointer info-color"
                                            ng-click="minusCustodian($index, detailInfo.list)"
                                            ng-show="(detailInfo.list.length > 1) && ($index < (detailInfo.list.length - 1))"
                                            style="font-size: 24px;line-height: 34px;"></i>
                                        <i class="yb-icon ico-plus-o pull-left cursor-pointer info-color"
                                            ng-click="plusCustodian(detailInfo.list)"
                                            ng-show="(detailInfo.list.length === 0) || ($index === (detailInfo.list.length - 1))"
                                            style="font-size: 24px;line-height: 34px;"></i>
                                    </li>
                                </ul>
                            </div>
                        </div>

                    </div>
                </form>
            </div>
            <div class="bottom-area btn-bar single-col border-t clearfix">
                <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid)">
                    保存
                </button>
                <button type="button" class="btn btn-default" ng-click="changeTab(0)">取消</button>
            </div>
        </div>
        <div tab heading="详情" active="activeFlag[2]" ng-if="activeFlag[2]">
            <div class="main-area d-t-35 d-b-60">
                <form name="form" class="main-wrap form-horizontal single-col p-t-xs clearfix" novalidate>
                    <div class="panel-bar clearfix">
                        <div class="pull-left">
                            <i></i>线路产品
                        </div>
                    </div>
                    <div class="clearfix p-t">
                        <div class="form-group">
                            <label class="col-xs-2 control-label">规则描述：</label>
                            <div class="col-xs-5 control-label text-left">{{detailInfo.destinationCity}}</div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">承运商：</label>
                            <div class="col-xs-5 control-label text-left">{{detailInfo.carrierOrgName}}</div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">出发城市：</label>
                            <div class="col-xs-5 control-label text-left">{{detailInfo.departureCity}}</div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">目的城市：</label>
                            <div class="col-xs-5 control-label text-left">{{detailInfo.destinationCity}}</div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">里程（公里）：</label>
                            <div class="col-xs-5  control-label text-left"> {{detailInfo.mileage}}</div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">承诺时间（天）：</label>
                            <div class="col-xs-5  control-label text-left">{{detailInfo.commitmentTime}}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">首重（KG）：</label>
                            <div class="col-xs-5  control-label text-left">{{detailInfo.firstWeight}}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">首重金额（元）：</label>
                            <div class="col-xs-5  control-label text-left">{{detailInfo.firstAmount}}
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-xs-2 control-label">运费单价：</label>
                            <div class="col-xs-9 wrapper-none">
                                <ul class="row">
                                    <li class="m-b-xs clearfix" ng-repeat="item in detailInfo.list track by $index">
                                        <div class=" pull-left m-r-xs pos-r" style="min-width: 15%;">
                                            <div class="col-xs-12 control-label text-left">
                                                {{item.weightStart}}~{{item.weightEnd}}Kg
                                            </div>
                                        </div>
                                        <div class=" pull-left m-r-xs" style="min-width: 20%;">
                                            <div class="col-xs-12 control-label text-left">
                                                单价{{item.unitPrice}}元
                                            </div>
                                        </div>
                                        <div class=" pull-left m-r-xs" style="min-width: 25%;">
                                            <div class="col-xs-12 control-label text-left">
                                                附加{{item.additional}}元
                                            </div>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>

                    </div>
                </form>
            </div>
            <div class="bottom-area btn-bar single-col border-t clearfix">
                <button type="button" class="btn btn-default" ng-click="changeTab(0)">返回</button>
            </div>
        </div>
    </div>
</div>